package cn.com.Kol.ITPMP.TenMajorAreas.model;

import cn.com.Kol.ITPMP.System.Area;
import cn.com.Kol.ITPMP.System.Process;

import static cn.com.Kol.ITPMP.System.Constants.*;

public class ScheduleManagement extends Area {

    private Process MakeScheduleManagementPlan = new Process(MAKE_SCHEDULE_MANAGEMENT_PLAN);
    private Process ActivityDefinition = new Process(ACTIVITY_DEFINITION);
    private Process ActivitySequencing = new Process(ACTIVITY_SEQUENCING);
    private Process ActivityResourceEstimate = new Process(ACTIVITY_RESOURCE_ESTIMATE);
    private Process EstimateActivityDuration = new Process(ESTIMATE_ACTIVITY_DURATION);
    private Process MakeSchedulePlan = new Process(MAKE_SCHEDULE_PLAN);
    private Process ScheduleControl = new Process(SCHEDULE_CONTROL);


    private void ScheduleManagementProcess(){
        CreateProcess(MakeScheduleManagementPlan);
        CreateProcess(ActivityDefinition);
        CreateProcess(ActivitySequencing);
        CreateProcess(ActivityResourceEstimate);
        CreateProcess(EstimateActivityDuration);
        CreateProcess(MakeSchedulePlan);
        CreateProcess(ScheduleControl);
    }

    public void SetInputs(Process process){
        switch (process.getProcessName()){
            case "规划进度管理":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(PROJECT_CHARTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "活动定义":
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(SCOPE_BASELINE);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "活动排序":
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(ACTIVITY_LIST);
                process.inputs(ACTIVITY_ATTRIBUTE);
                process.inputs(MILESTONE_LIST);
                process.inputs(PROJECT_SCOPE_STATEMENT);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "活动资源估算":
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(ACTIVITY_LIST);
                process.inputs(ACTIVITY_ATTRIBUTE);
                process.inputs(RESOURCE_CALENDAR);
                process.inputs(RISK_REGISTER);
                process.inputs(ACTIVITY_COST_ESTIMATE);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "估算活动持续时间":
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(ACTIVITY_LIST);
                process.inputs(ACTIVITY_ATTRIBUTE);
                process.inputs(ACTIVITY_RESOURCE_REQUIREMENTS);
                process.inputs(RESOURCE_CALENDAR);
                process.inputs(PROJECT_SCOPE_STATEMENT);
                process.inputs(RISK_REGISTER);
                process.inputs(RESOURCE_BREAKDOWN_STRUCTURE);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "制定进度计划":
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(ACTIVITY_LIST);
                process.inputs(ACTIVITY_ATTRIBUTE);
                process.inputs(PROJECT_SCHEDULE_NETWORK_DIAGRAMS);
                process.inputs(ACTIVITY_RESOURCE_REQUIREMENTS);
                process.inputs(RESOURCE_CALENDAR);
                process.inputs(ACTIVITY_DURATION_ESTIMATES);
                process.inputs(PROJECT_SCOPE_STATEMENT);
                process.inputs(RISK_REGISTER);
                process.inputs(PROJECT_PERSONNEL_ASSIGNMENT);
                process.inputs(RESOURCE_BREAKDOWN_STRUCTURE);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "进度控制":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(PROJECT_SCHEDULE);
                process.inputs(WORK_PERFORMANCE_DATA);
                process.inputs(PROJECT_CALENDAR);
                process.inputs(SCHEDULE_DATA);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;

        }
    }

    public void UseToolAndTech(Process process){
        switch (process.getProcessName()){
            case "规划进度管理":
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(ANALYSIS_TECHNICS);
                process.useToolAndTech(CONFERENCE);
                break;
            case "活动定义":
                process.useToolAndTech(BREAKDOWN);
                process.useToolAndTech(ROLLING_PLANNING);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                break;
            case "活动排序":
                process.useToolAndTech(PRECEDENCE_DIAGRAMMING_METHOD);
                process.useToolAndTech(DEPENDENCY_DETERMINATION);
                process.useToolAndTech(LEAD_AND_LAG);
                break;
            case "活动资源估算":
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(ALTERNATIVE_PLAN_ANALYSIS);
                process.useToolAndTech(PUBLISHED_ESTIMATE_DATA);
                process.useToolAndTech(BOTTOM_UP_ESTIMATE);
                process.useToolAndTech(PROJECT_MANAGEMENT_SOFTWARE);
                break;
            case "估算活动持续时间":
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(ANALOGY_ESTIMATE);
                process.useToolAndTech(PARAMETER_ESTIMATE);
                process.useToolAndTech(THREE_POINT_ESTIMATE);
                process.useToolAndTech(GROUP_DECISION_MAKING_TECHNIQUE);
                process.useToolAndTech(RESERVE_ANALYSIS);
                break;
            case "制定进度计划":
                process.useToolAndTech(SCHEDULE_NETWORK_ANALYSIS);
                process.useToolAndTech(CRITICAL_PATH_METHOD);
                process.useToolAndTech(CRITICAL_CHAIN_METHOD);
                process.useToolAndTech(RESOURCE_OPTIMIZATION_TECHNIQUES);
                process.useToolAndTech(MODELING_TECHNOLOGY);
                process.useToolAndTech(LEAD_AND_LAG);
                process.useToolAndTech(SCHEDULE_COMPRESSION);
                process.useToolAndTech(SCHEDULING_TOOLS);
                break;
            case "进度控制":
                process.useToolAndTech(PERFORMANCE_REVIEWS);
                process.useToolAndTech(PROJECT_MANAGEMENT_SOFTWARE);
                process.useToolAndTech(RESOURCE_OPTIMIZATION_TECHNIQUES);
                process.useToolAndTech(MODELING_TECHNOLOGY);
                process.useToolAndTech(LEAD_AND_LAG);
                process.useToolAndTech(SCHEDULE_COMPRESSION);
                process.useToolAndTech(SCHEDULING_TOOLS);
                break;
        }
    }

    public void SetOutputs(Process process){
        switch (process.getProcessName()){
            case "规划进度管理":
                process.outputs(SCHEDULE_MANAGEMENT_PLAN);
                break;
            case "活动定义":
                process.outputs(ACTIVITY_LIST);
                process.outputs(ACTIVITY_ATTRIBUTE);
                process.outputs(MILESTONE_LIST);
                break;
            case "活动排序":
                process.outputs(PROJECT_SCHEDULE_NETWORK_DIAGRAMS);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "活动资源估算":
                process.outputs(ACTIVITY_RESOURCE_REQUIREMENTS);
                process.outputs(RESOURCE_BREAKDOWN_STRUCTURE);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "估算活动持续时间":
                process.outputs(ACTIVITY_DURATION_ESTIMATES);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "制定进度计划":
                process.outputs(SCHEDULE_BASELINE);
                process.outputs(PROJECT_SCHEDULE);
                process.outputs(SCHEDULE_DATA);
                process.outputs(PROJECT_CALENDAR);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "进度控制":
                process.outputs(WORK_PERFORMANCE_INFO);
                process.outputs(SCHEDULE_PREDICTION);
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
                break;
        }

    }

}
